<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>授权</title>
</head>
<body>
<a href="" id="auth">授权</a>
</body>
<script src="//libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
  $(function () {
    $.ajax({
      url: '/api/wechat/platform/authorize?id=1',
      success: function (result) {
        console.log(result);
        $('#auth').attr('href', result.data.redirect);
      }
    });
  });
</script>
</html>